package com.atguigu01._static.apply;

/**
 * ClassName: CircleTest
 * Package: com.atguigu01._static.apply
 * Description:
 *
 * @Author ZY
 * @Create 22:15
 * @Version 1.0
 */
public class CircleTest {

    public static void main(String[] args) {
        Circle c1 = new Circle();

        System.out.println(c1);

        Circle c2 = new Circle();

        System.out.println(c2);

        Circle c3 = new Circle();

        System.out.println(c3);

        System.out.println(c1.total);

    }



}

class Circle{
    double radius;//实例变量

    private int id;//编号

    static int total;//创建的Circle实例的个数

    public Circle(){
        this.id = init;
        init++;
        total++;
    }

    private static int init = 1001;

    @Override
    public String toString() {
        return "Circle{" +
                "radius=" + radius +
                ", id=" + id +
                '}';
    }
}


